package com.superatom.designpattern.singleton.eagersingleton;

/**
 * 单例模式-饿汉模式-是线程安全的
 */
public class EagerSingleton {

    private static final EagerSingleton instance = new  EagerSingleton();

    private EagerSingleton(){

    }

    public static EagerSingleton getInstance(){
        System.out.println(System.currentTimeMillis() + ":" + instance);
        return instance;
    }
}
